package cn.micai.base.thread;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 描述：并发类容器
 * <p>
 *
 * @author: 赵新国
 * @date: 2018/2/22 16:03
 */
public class UserConcurrentHashMap {

    public static void main(String [] args) {
        ConcurrentHashMap<String, Object> chm = new ConcurrentHashMap<>();

        chm.put("k1","v1");
        chm.put("k2","v2");
        chm.put("k3","v3");

        chm.putIfAbsent("k4","vvvv");

        for (Map.Entry<String, Object> me : chm.entrySet()) {
            System.out.println("key:" + me.getKey()+",value:"+me.getValue());
        }
    }
}
